package org.openCage.artig;

import org.openCage.artig.stjx.Artifact;
import org.openCage.artig.stjx.ArtifactRef;
import org.openCage.artig.stjx.Deployed;
import org.openCage.lang.functions.F1;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class DeployedUtils {

    public static List<Artifact> getDependenciesTrans( Deployed depl, F1<Boolean, ArtifactRef> cond ) {

        List<Artifact> ret = new ArrayList<Artifact>();
        List<ArtifactRef> refs = new ArrayList<ArtifactRef>();

        for ( ArtifactRef ref : depl.getArtifact().getDepends() ) {

            if ( cond.call( ref )) {
                refs.add( ref );
            }

        }

        return ret;
    }

}
